package com.idanchuang.count.core.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.springframework.kafka.support.SendResult;
import org.springframework.util.concurrent.ListenableFutureCallback;

/**
 * @author Richard_yyf
 * @version 1.0 2021/9/26
 */
@Getter
public class KafkaSendEvent {

    private final ProducerRecord<Object, Object> record;
    private ListenableFutureCallback<SendResult<Object, Object>> callback;

    public KafkaSendEvent(ProducerRecord<Object, Object> record) {
        this(record, null);
    }

    public KafkaSendEvent(ProducerRecord<Object, Object> record, ListenableFutureCallback<SendResult<Object, Object>> callback) {
        this.record = record;
        this.callback = callback;
    }
}
